<?php

session_start();
$img_number = imagecreate(100,25);
$white = imagecolorallocate($img_number,255,255,255);
$black = imagecolorallocate($img_number,0,0,0);

$number = get_random();
session_register('randomNumber');
$_SESSION['randomNumber']=$number;

Imagestring($img_number,9,1,1,$number,$black);

header("Content-type: image/jpeg");
imagejpeg($img_number);

function get_random(){
    srand(time());
    $max = getrandmax();
    return rand(1,$max) + rand(1,$max) ;
}

?> 
